import 'package:flutter_test/flutter_test.dart';
import 'package:jieli_ble_ota_plugin/jieli_ble_ota_plugin.dart';
import 'package:jieli_ble_ota_plugin/jieli_ble_ota_plugin_platform_interface.dart';
import 'package:jieli_ble_ota_plugin/jieli_ble_ota_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockJieliBleOtaPluginPlatform
    with MockPlatformInterfaceMixin
    implements JieliBleOtaPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final JieliBleOtaPluginPlatform initialPlatform = JieliBleOtaPluginPlatform.instance;

  test('$MethodChannelJieliBleOtaPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelJieliBleOtaPlugin>());
  });

  test('getPlatformVersion', () async {
    JieliBleOtaPlugin jieliBleOtaPlugin = JieliBleOtaPlugin();
    MockJieliBleOtaPluginPlatform fakePlatform = MockJieliBleOtaPluginPlatform();
    JieliBleOtaPluginPlatform.instance = fakePlatform;

    expect(await jieliBleOtaPlugin.getPlatformVersion(), '42');
  });
}
